import time

def aaa(bruh):
    yoo = True
    while yoo:
        yoo = False
        for i in range(len(bruh) - 1):
            if bruh[i] > bruh[i + 1]:
                bruh[i], bruh[i + 1] = bruh[i + 1], bruh[i]
                yoo = True

def lmfao(hihiha):
    z = open(hihiha, 'r')
    x = z.readlines()
    return x

m1 = lmfao("m1_sorted.txt")
m2 = lmfao("m2_reverse.txt")
m3 = lmfao("m3_shuffle.txt")

t_ez = time.time()
aaa(m1)
t_boo = time.time()
print("m1_sorted",round((t_boo-t_ez)*1000),"milliseconds")

t_ez = time.time()
aaa(m2)
t_boo = time.time()
print("m2_reverse",round((t_boo-t_ez)*1000),"milliseconds")

t_ez = time.time()
aaa(m3)
t_boo = time.time()
print("m3_shuffle",round((t_boo-t_ez)*1000),"milliseconds")
